package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.entity.CouponStaff;
import com.dingreading.cloud.common.util.PageUtil;
import com.google.common.collect.HashBasedTable;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;

import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface CouponStaffService extends IService<CouponStaff> {

    Page<CouponStaff> pageList(PageUtil pageUtil, String keyword, Integer enabled);

    void updateEnabled(Long id, Integer enabled);

    int dropData(Long id);

    List<CouponStaff> getByCouponId(Long couponId, Integer enabled, String keyword, List<String> staffUids);

    long getCntByCouponId(Long couponId);

    CouponStaff getStaffCoupon(String storeUid, String staffUid, Long id);

    void updateEnabledByCouponId(Long couponId, Integer enabled);

    long dropDataByCouponId(Long id);

    // 获取代金券发放给员工的总数量
    HashBasedTable<String, String, Integer> getStoreStaffSendNum(Long couponId, Integer enabled, List<String> staffUids);

    // 撤回订单付款的金额
    boolean revocationMoney(String storeUid, String staffUid, Long id, double usedMoney, double usableMoney);

    void updateByCouponId(
            Long couponId, Long typeId, String couponName, String goodsIds, String goodsCategoryIds,
            String staffUid, String staffName
    );
}
